import java.util.*;

public class Test {
    public static void main(String[] args) {
        //双端队列的链式存储
        Deque<Integer> deque = new LinkedList<>();

        //双端队列的线性存储
        Deque<Integer> deque1 = new ArrayDeque<>();
    }
    public static void main7(String[] args) {
        Queue<Integer> queue = new LinkedList<>();
        queue.offer(1);
        queue.offer(2);
        queue.offer(3);
        queue.offer(4);
        queue.offer(5);

        System.out.println(queue.peek());
        System.out.println(queue.poll());
        System.out.println(queue.peek());

        System.out.println("===========");

        MyQueue myQueue = new MyQueue();
        myQueue.offer(1);
        myQueue.offer(2);
        myQueue.offer(3);
        myQueue.offer(4);
        myQueue.offer(5);

        System.out.println(myQueue.peek());
        System.out.println(myQueue.poll());
        System.out.println(myQueue.peek());

    }
    public static void main6(String[] args) {
        Queue<Integer> queue = new LinkedList<>();
        queue.offer(1);
        queue.offer(2);
        queue.offer(3);
        queue.offer(4);
        queue.offer(5);

        System.out.println(queue);

    }
    public static void main5(String[] args) {
        MyQueue myQueue = new MyQueue();
        myQueue.offer(1);
        myQueue.offer(2);
        myQueue.offer(3);
        myQueue.offer(4);
        myQueue.offer(5);

        System.out.println(myQueue.size());

        System.out.println(myQueue.poll());
        System.out.println(myQueue.peek());

        myQueue.display();
    }
    public static void main4(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(12);
        stack.push(23);
        System.out.println(stack.pop());
        System.out.println(stack.peek());

        System.out.println("============");
        MyStack myStack = new MyStack();
        myStack.push(12);
        myStack.push(23);
        System.out.println(stack.pop());
        System.out.println(myStack.peek());
    }
    public static void main3(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(12);
        stack.push(23);
        System.out.println(stack.peek());

        System.out.println("============");
        MyStack myStack = new MyStack();
        myStack.push(12);
        myStack.push(23);
        System.out.println(myStack.peek());
    }
    public static void main2(String[] args) {
        //empty()
        //方法的试验
        Stack<Integer> stack = new Stack<>();
        System.out.println(stack.empty());

        System.out.println("============");
        MyStack myStack = new MyStack();
        System.out.println(myStack.empty());
    }
    public static void main1(String[] args) {
        //Statck
        //push
        //方法的试验
        Stack<Integer> stack = new Stack<>();
        stack.push(12);
        stack.push(23);
        stack.push(55);
        stack.push(46);
        stack.push(78);

        System.out.println(stack);
        System.out.println("===========");
        //自实现的
        MyStack myStack = new MyStack();
        myStack.push(12);
        myStack.push(23);
        myStack.push(55);
        myStack.push(46);
        myStack.push(78);
        myStack.display();
    }
}
